# Author: mosra <mosra@centrum.cz>
pkgname=magnum-integration
pkgver=dev
pkgrel=1
pkgdesc="Integration libraries for the Magnum C++11/C++14 graphics engine"
arch=('i686' 'x86_64')
url="https://magnum.graphics"
license=('MIT')
depends=('magnum' 'bullet' 'eigen' 'glm' 'libdart' 'imgui-src')
makedepends=('cmake' 'ninja')
options=(!strip)
provides=('magnum-integration-git')

_rootdir=$startdir/../../

build() {
    mkdir -p "$_rootdir/build"
    cd "$_rootdir/build"

    cmake .. \
        -DCMAKE_BUILD_TYPE=Debug \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DIMGUI_DIR=/opt/imgui \
        -DWITH_BULLET=ON \
        -DWITH_DART=ON \
        -DWITH_EIGEN=ON \
        -DWITH_GLM=ON \
        -DWITH_IMGUI=ON \
        -DBUILD_TESTS=ON \
        -DBUILD_GL_TESTS=ON \
        -G Ninja
    ninja
}

check() {
    cd "$_rootdir/build"
    CORRADE_TEST_COLOR=ON ctest --output-on-failure
}

package() {
    cd "$_rootdir/build"
    DESTDIR="$pkgdir/" ninja install
}
